﻿using MyConsoleApp1;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            var uid = textBox1.Text;
            var passWord = textBox2.Text;
             
            var a = SQLdbHelper.Operate1("select username,userPassword from userRegister where username='" + uid + "' and userPassword='" + passWord + "'");
            if (a != 0)
            {

                MessageBox.Show("登录成功！", "提示");
               
                //Form3 form3 = new Form3();
                this.Hide();
                //form3.Show();


            }
            else
            {
                MessageBox.Show("登录失败！用户名或密码错误", "提示");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Form2 form = new Form2();
            form.Show();
        }
    }
}
